<?php
use frontend\assets\AppAsset;
use yii\helpers\Url;
use yii\bootstrap\ActiveForm;
use yii\captcha\Captcha;

$this->title = '登录';
$this->params['breadcrumbs'][] = $this->title;
$image_bath_url = Yii::$app->params['imageBathUrl'];
?>
<?php
AppAsset::addCss($this,$image_bath_url."/static/pc/css/login.css");
?>
<section class="form_box">
<div class="form-w">
    <!-- 路径 -->
    <div class="form_title">
        <div><span>首页</span> > <span>登录</span></div>
    </div>
    <!-- 路径End -->
    <div class="form_content">
        <div class="form-w-inner">
            <div class="form-left">
                <h1 class="h1">会员登录</h1>
                <div class="login_list_btn mt40">
                    <a href="javascript:;" class="link-text password_login a-active">账号密码登录</a>
                    <a href="javascript:;" class="link-text phoneV_login">手机验证码登录</a>
                </div>
                <div class="form_input_group mt40">

                    <div class="tab_form_password tab1 show" id="form_1">
                        <?php
                        $form = ActiveForm::begin(['id' => 'login-one-form','action'=>'/login/index','method'=>'post']);
                        ?>
                        <?= $form->field($model, 'mobile',['template'=>'<div class="form_phone_group input-box"><label class="input_add_icon">手机号:</label>{input}</div>'])
                            ->textInput(['class' => 'input_value js_phone','placeholder'=>'输入手机号']) ?>

                        <?= $form->field($model, 'pwd',['template'=>' <div class="form_password_group mt25 input-box"><label class="input_add_icon">密码:</label>{input}</div>'])
                            ->textInput(['type'=>'password','class' => 'input_value js_password','placeholder'=>'输入密码']) ?>

                        <div class="form_forget_password mt20">
                            <input name="is_remember" id="is_remember" value="1" type="checkbox" class="checkbox_input"/>
                            <label>记住账户</label>
                            <a href="<?php echo Url::to(['/login/forget-password']);?>" class="forget_password">忘记密码？</a>
                        </div>
                        <?php ActiveForm::end(); ?>
                    </div>

                    <div class="tab_form_phone tab1 hide" id="form_2">
                        <?php
                        $form = ActiveForm::begin(['id' => 'login-mobile-form','action'=>'mobile-login','method'=>'post']);
                        ?>

                        <?= $form->field($mobile_model, 'mobile',['template'=>'<div class="form_phone_group input-box"><label class="input_add_icon">手机号:</label>{input}</div>'])
                            ->textInput(['class' => 'input_value js_phone','placeholder'=>'输入手机号']) ?>

                        <?= $form->field($captcha_model, 'verifyCode')->widget(Captcha::className(), ['captchaAction'=>'login/captcha',
                            'template' => '<div class="img_verification verification_input input-box mt25"><input id="captchaform-verifyCode" name="CaptchaForm[verifyCode]" type="text" class="img_verification_value v-text input_value js_img_code" placeholder="输入图形验证码"/><span class="img_show v-btn">{image}</span></div>',
                        ]) ?>

                        <?= $form->field($mobile_model, 'mobileCode',['template'=>'<div class="phone_verification verification_input mt25 input-box">{input}<button type="button" class="phoneV_btn v-btn">获取手机验证码</button></div>'])
                            ->textInput(['class' => 'phoneV_value v-text input_value js_phone_code','placeholder'=>'输入手机验证码']) ?>
                        <?php ActiveForm::end(); ?>
                    </div>
                    <div class="user_login_btn">
                        <span class="tipinfo"></span>
                        <button type="submit" class="user_login btn js_login_btn1 show">登录<i class="icon arrow_icon"></i></button>
                        <button type="submit" class="user_login btn js_login_btn2 hide" >登录<i class="icon arrow_icon"></i></button>
                        <div class="webchat_login">
                            <span class="icon icon-wechat-login"></span>
                            <a href="javascript:;">微信快捷登录</a>
                        </div>
                    </div>
                </div>

            </div>
            <span class="bg_line icon icon-bg-line "></span>
            <div class="form_right">
                <h3>还不是会员？</h3>
                <a href="<?php echo Url::to(['/login/register']);?>" class="go_register btn">立即注册<i class="icon arrow_icon"></i></a>
            </div>
        </div>
    </div>
</div>
</section>
<?php
AppAsset::addJs($this,$image_bath_url."/static/common/jquery.cookie.js");
AppAsset::addJs($this,$image_bath_url."/static/pc/js/formValidate.js?ver=001");
?>

